﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Final.App_Code
{
    public class StudentSubject
    {
        private string adminno;
        private string name;
        private string password;
        private string coursecode;
        private string coursename;
        private string module;
        private int contact;
        private string email;
        private string subjectname;
        private string subjectdesc;

        public string Adminno
        {
            get { return adminno; }
            set { adminno = value; }
        }
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public string Password
        {
            get { return password; }
            set { password = value; }
        }
        public string Coursecode
        {
            get { return coursecode; }
            set { coursecode = value; }
        }
        public string Coursename
        {
            get { return coursename; }
            set { coursename = value; }
        }
        public int Contact
        {
            get { return contact; }
            set { contact = value; }
        }
        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        public string Module
        {
            get { return module; }
            set { module = value; }
        }
        public string Subjectname
        {
            get { return Subjectname; }
            set { Subjectname = value; }
        }
        public string Subjectdesc
        {
            get { return Subjectdesc; }
            set { Subjectdesc = value; }
        }

        public StudentSubject()
        {
        }
        
         public StudentSubject(string adminno, string name, string password, string coursecode, string coursename, string m, int contact, string email, string subjectname, string subjectdesc)
        {
            this.adminno = adminno;
            this.name = name;
            this.password = password;
            this.coursecode = coursecode;
            this.coursename = coursename;
            this.module = m;
            this.contact = contact;
            this.email = email;
            this.subjectname = subjectname;
            this.subjectdesc= subjectdesc;
        }

         public List<StudentSubject> RetrieveDetails()
         {
             StudentDataClass sdc = new StudentDataClass();
             List<Student> list = sdc.ListAll();
             subject_description sd = new subject_description();
             List<Subject> list2 = sd.List2();
             List<StudentSubject> mcList = new List<StudentSubject>();
             for (int i = 0; i < list.Count; i++)
             {
                 StudentSubject mc = new StudentSubject(list[i].Adminno, list[i].Name, list[i].Password,list[i].Coursecode,list[i].Coursename,list[i].Module,list[i].Contact,list[i].Email,list2[i].Subjectname,list2[i].Subjectdesc);
                 mcList.Add(mc);
             }
             return mcList;
         }
    }
}